using System;

using System.Collections;

namespace Curriculum.Business
{
	/// <summary>
	/// Summary description for ListaAbstracta.
	/// </summary>
	public abstract class ListaAbstracta : ICollection
	{
		protected ArrayList lista = new ArrayList();
		public ListaAbstracta()
		{}

		public void Add(object valor)
		{
			this.lista.Add(valor);
		}
		public void SetPosition(int i, object valor)
		{
			this.lista[i]=valor;
		}
		public void Remove(object valor)
		{
			this.lista.Remove(valor);
		}
		public object GetValue(int index)
		{
			try
			{
				return this.lista[index];
			}
			catch
			{
				return null;
			}
		}



		#region ICollection Members

		public bool IsSynchronized
		{
			get
			{
				return this.lista.IsSynchronized;
			}
		}

		public int Count
		{
			get
			{
				return this.lista.Count;
			}
		}

		public void CopyTo(System.Array array, int index)
		{
			this.lista.CopyTo(array, index);
		}

		public object SyncRoot
		{
			get
			{
				return this.lista.SyncRoot;
			}
		}

		#endregion

		#region IEnumerable Members

		public IEnumerator GetEnumerator()
		{
			return this.lista.GetEnumerator();
		}

		#endregion
	}
}
